package com.szms.mobile.util;

import com.szms.mobile.R;
import com.szms.mobile.check.PhotoFragment;
import com.szms.mobile.me.LoginFragment;
import com.szms.mobile.me.MeFragment;
import com.szms.mobile.me.SystemFragment;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class MenuUtils {

    private static MenuUtils _instance;
    private  static Object lockObj = new Object();

    public static MenuUtils Instance(){
        if(_instance==null){
            synchronized (lockObj){
                if (_instance==null){
                    _instance = new MenuUtils();
                }
            }
        }
        return _instance;
    }

    /**
     * 菜单map
     */
    private Map<Integer, List<Class>> menuMap = new ConcurrentHashMap<>();

    private MenuUtils(){
        menuMap.put(R.id.layoutme, Arrays.asList(MeFragment.class, LoginFragment.class, SystemFragment.class));
        menuMap.put(R.id.layoutphoto,Arrays.asList(PhotoFragment.class));
    }

    /**
     * 获取菜单对应fragment的字典
     * @return
     */
    public Map<Integer, List<Class>> getMap(){
        return  menuMap;
    }
}
